package org.ITschool.support.util;

import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

import net.coobird.thumbnailator.Thumbnails;
import net.coobird.thumbnailator.geometry.Positions;

public class ThumbImgFactory {
   public static String create_thumbimg(String inputimgfile,String outputpath){
	   File file=new File(inputimgfile);
	   String filename=inputimgfile.substring(inputimgfile.lastIndexOf("/"));
	   try {
		Thumbnails.of(file).size(400,500)
		.watermark(Positions.BOTTOM_RIGHT, ImageIO.read(new File("D:\\tomcat 7.0\\webapps\\fileserver\\watermark.png")), 0.5f)
		.outputQuality(0.8f).toFile(outputpath+filename);
		
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	   return "";
   }
}
